import * as proxy from '@/constants/proxy';
import { CHECC_API_PROCESS } from '@/constants/proxy';
import { getThreeMonths } from "@/utils/currency";
import request from '@/utils/request';

//待办，已办，待阅，已阅流程任务数量
export function getNum(data: any) {
  return request({
    url:'/process-api/act/task/getTaskSummary',
    method: 'post',
    data
  })
}
//Y预警总数
export function earlyWarningNum() {
  return request({
    url: proxy.CHECC_API_CMS + '/sy/earlyWarning/getCount', 
    method: 'post',
  })
}
//Y预警列表
export function earlyWarningList(data:any) {
  return request({
    url: proxy.CHECC_API_CMS + '/warning/search',
    method: 'post',
    data,
  })
}
//通知公告
export function getNotice(data:any) {
  return request({
    url: '/checc-api/news/getNewsTitles?type=' + data,
    method: 'get',
  })
}//通知公告1
export function getNotice1(data:any) {
  return request({
    url: '/checc-api/news/get',
    method: 'post',
    data,
  })
}

//查询tode 
export function getTable( params = { endTime: new Date().getTime(), startTime: getThreeMonths()}) {
  return request({
      url: CHECC_API_PROCESS + `/act/task/todo`,
      method: 'get',
      params
  })
}


export function getDealTables(params = { endTime: new Date().getTime(), startTime: getThreeMonths()} ) {
  return request({
      url: CHECC_API_PROCESS + `/act/task/done`,
      method: 'get',
      params
  })
}

export function getToReadTables(data: any, params: any ) {
  return request({
       url: '/process-api/copy-task/page',
      method: 'post',
      data,
      params
  })
}

// 审核通过

export function allowProcess(data:any) {
  return request({
      url: '/process-api/act/task/completeTaskByVo',
      method: 'post',
      data
  })
}

// 审核拒绝

export function refuseProcess(data:any) {
  return request({
      url: '/process-api/act/task/over',
      method: 'post',
      data
  })
}
